﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Testing._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        
        .style1
        {
            width: 97px;
        }
        
        </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        
        Welcome to Learners!
               
                    <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
                    <asp:Timer ID="Timer1" runat="server" Interval="1000">
                    </asp:Timer>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
                        </ContentTemplate>
                    </asp:UpdatePanel>
    </h2>
    <table style="width: 100%;">
        <tr>
            <td class="_table1">
                <fieldset class="_fieldset">
                    
                    <asp:Image ID="Image2" runat="server" Height="291px" ImageAlign="Middle" 
                        ImageUrl="~/BookCovers/front_Image.gif" Width="289px" />
                </fieldset>
            </td>
            <td class="_table1">
                <fieldset class="_fieldset">
                    <legend>Recent Articles</legend>
                    <asp:ListView ID="ListView2" runat="server" DataSourceID="SqlDataSource2">
                    <ItemTemplate>
                        <p style="color:Fuchsia; font-weight:bolder;"><%# Eval("A_Name")%><br /></p>
                        Posted on <%# Eval("A_PostDate")%><br />
                        <a href='ArticleDetails.aspx?ID=<%# Eval("ID") %>' style="text-align:right">More....</a>
                        <br />
                        <hr />
                           
                    </ItemTemplate>
                    </asp:ListView>
                    
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:DBConnString %>" 
                        ProviderName="<%$ ConnectionStrings:DBConnString.ProviderName %>" 
                        SelectCommand="SELECT TOP 5 [ID], [A_Name], [A_PostDate] FROM [Articles] ORDER BY [ID] DESC">
                    </asp:SqlDataSource>
                   <div style="text-align:right;"> <a href="Articles.aspx">See all ....</a></div>


                </fieldset>
            </td>
            <td class="_table1">
                <fieldset class="_fieldset">
                    <legend>Recent Materials</legend>
                    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
                    <ItemTemplate>
                    <table style="width: 100%; height: 118px;">
                        <tr>
                            <td class="style1" rowspan="3">
                              <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("B_Picture") %>' Width="50" Height="80" /></td>
                            <td>
                                Name: <%# Eval("B_Name")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               Price: <%# Eval("B_Price")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               <a href='Details.aspx?ID=<%# Eval("ID") %>'>More....</a>
                            </td>
                        </tr>
                    </table>
                    </ItemTemplate>
                    </asp:ListView>
                    
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:DBConnString %>" 
                        ProviderName="<%$ ConnectionStrings:DBConnString.ProviderName %>" 
                        SelectCommand="SELECT TOP 3 [ID], [B_Picture], [B_Price], [B_Name] FROM [Books] Order By [ID] DESC">
                    </asp:SqlDataSource>
                   <div style="text-align:right;"> <a href="List.aspx">See all ....</a></div>
                </fieldset>
            </td>
        </tr>
    </table>

</asp:Content>
